﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZF.BLL;
using GCELibrary.Current;
namespace ZF.WS.fz
{
    public partial class fx : BLL.Page.PageBase
    {
        [PageArgument(Key = "id", CanNull = false)]
        public int Id { get; set; }
        public Model.G_Buddha Buddha { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            using (var dc = SiteInfo.CreateDBDataContext())
            {
                Buddha = dc.G_Buddha.FirstOrDefault(p => p.BuddhaId == Id);
                if (Buddha == null)
                {
                    throw WarnFactory.CreateWarn(WarnCode.ReocrdNoFind);
                }
               var gplist= dc.G_Bowing.Where(p => p.BuddhaId == Buddha.BuddhaId && p.AddTime > DateTime.Now.AddDays(-1))
                   .Join(dc.US_Member,p=>p.MemberId,m=>m.MemberId,(p,m)=>new
                   {
                       Path=p.Path,
                       X=p.X,
                       Y=p.Y,
                       Name=m.Account,
                       Msg=p.Msg,

                   }).Take(20).ToList();
               this.lvList.DataSource = gplist;
               this.lvList.DataBind();


              
                
            }
        }
    }
}
